package org.cpoy.ei.session;

import org.cpoy.eims.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("certificateList")
public class CertificateList extends EntityQuery<Certificate> {

	private static final String EJBQL = "select certificate from Certificate certificate";

	private static final String[] RESTRICTIONS = {
			"lower(certificate.certificateName) like lower(concat(#{certificateList.certificate.certificateName},'%'))",
			"lower(certificate.description) like lower(concat(#{certificateList.certificate.description},'%'))", };

	private Certificate certificate = new Certificate();

	public CertificateList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Certificate getCertificate() {
		return certificate;
	}
}
